package com.system.common.constant;

/**
 * 系统响应码Enum
 * code 值 除了成功是一位之外，其他都是8位
 * 前两位是系统错误
 * 中间三位是模块错误
 * 后三位是具体业务错误
 *
 *
 */
public enum BaseEnum {
    SUCCESS(0, "成功"),
    // 系统级别 10 开始
    SYS_ERROR(10000001, "系统异常"),
    IO_ERROR(11000001, "网络异常"),
    ENCRYPTION_ERROR(12000001, "加密失败"),
    DECRYPTION_ERROR(13000001, "解密失败"),
    ILLEGAL_OPERATION(14000001, "非法操作"),
    RESULT_NULL(14000002,"查询结果为空"),
    ARGS_ERROR(15000001, "请求参数错误"),

    // 人员模块 100,
    PERSON_LOGIN_ERROR(15100001, "登陆名或密码错误"),
    PERSON_SAVE_ARGS_ERROR(15100002, "登陆名或密码为空"),
    PERSON_DEL_ARGS_ERROR(15100003, "ID为空"),
    PERSON_IMAGE_CODE_ERROR(15100004, "验证码错误"),
    PERSON_NOT_LOGIN(15100005, "用户未登陆"),

    // 角色模块101，
    ROLE_SAVE_ARGS_ERROR(15101001,"角色名已存在"),
    ROLE_DEL_ARGS_ERROR(15101002,"ID为空"),
    // 权限模块 102
    PURVIEW_MENU_ARGS_NULL(15102001,"权限为空"),
    PURVIEW_MENU_ARGS_ERROR(15102002,"参数错误"),
    PURVIEW_MENU_HAS_CHILDREN(15102003,"存在子节点"),
    PURVIEW_NOT_MATCH(15102004,"未分配权限"),
    ;

    private int code;
    private String msg;

    BaseEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
